﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace Slaks.Graphs.Category
{
    public class CategoriesFile
    {
        public string Filename { get; set; }
        public Document2CategoryMap DocumentToCategoryMap { get; set; }
        public IDictionary<string, int> CategoryFrequencyMap { get; set; }
        public IList categoriesList { get; set; }
        public void FillCateogriesFromFile(string filename)
        {
            Filename = filename;
            Document2CategoryMap doc2CatMap;
            IDictionary<string, int> catFreqMap;
            CategoryReader.ReadCategoryFile(filename, out doc2CatMap,out catFreqMap);
            DocumentToCategoryMap = doc2CatMap;
            CategoryFrequencyMap = catFreqMap;
            ArrayList m_categoryList = new ArrayList(CategoryFrequencyMap.Keys.Count);
            foreach (string category in CategoryFrequencyMap.Keys)
            {
                m_categoryList.Add(category);
            }
            categoriesList = m_categoryList;
        }
    }
}
